package cn.sofwin.day0327;

public class Test01 {

    public static void main(String[] args) {
        Thread t1 = new MyThread();
        Thread t2 = new Thread(new MyTask());
        Thread t3 = new Thread(new Runnable(){
            @Override
            public void run() {
                System.out.println("匿名内部类也启动了...");
            }
        });
        Thread t4 = new Thread(() -> {
            System.out.println("lambda表达式启动了...");
        });

        t2.start();
        t3.start();
        t4.start();
        t1.start();
    }

    static class MyTask implements Runnable{
        @Override
        public void run() {
            System.out.println("线程也启动了...");
        }
    }

    static class MyThread extends Thread{
        @Override
        public void run() {
            System.out.println("线程启动了...");
        }
    }

}
